using Project_Schedule.Domain.Receptionist.com.core.dto;
using Project_Schedule.Model.EntitiesHelper;
using Project_Schedule.Utilities;

namespace Project_Schedule.Domain.Receptionist.com.core.utils;

public class System_RegisterTools
{
    /// <summary>
    /// 用户信息验证
    /// </summary>
    /// <param name="dto"></param>
    /// <param name="message"></param>
    /// <returns></returns>
    public static bool RegisterCheckout(RegisterUser dto, out string message)
    {
        message = string.Empty;
        if (dto.Account?.Length is < 6 or > 11)
            message = "账户长度错误 6～11";
        if (dto.Name?.Length is < 2 or > 5)
            message = "名字长度错误 2～5";
        if (dto.Password?.Length is < 6 or > 11)
            message = "密码长度错误 6～11";
        if (!dto.Phone!.IsPhoneNo())
            message = "手机号格式错误";
        if (message == string.Empty) return true;
        return false;
    }
}